package com.bsj.travel.device.service;

import com.bsj.travel.def.common.DTO.web.device.DeviceDTO;
import com.bsj.travel.def.common.DTO.web.device.DeviceParamDTO;
import com.bsj.travel.def.common.DTO.web.device.DeviceRemarkDTO;
import com.bsj.travel.def.common.DTO.web.device.DeviceSearchDTO;
import com.bsj.travel.def.common.VO.device.DeviceCorrelationInfoVO;
import com.bsj.travel.def.common.VO.device.DeviceExcelVO;
import com.bsj.travel.def.common.VO.device.DeviceVO;
import com.bsj.travel.def.common.VO.device.MqttSignatureExcelVO;
import com.bsj.travel.def.global.JsonResult;
import com.bsj.travel.def.mqtt.auth.MqttSignature;

import java.util.List;
import java.util.Map;

/***
 * @description DeviceService
 * @author LiJiaXin
 * @version 1.0.0
 * @time 2024/1/15 14:41
 **/
public interface DeviceService {

    /**
     * 添加设备
     *
     * @param deviceDTO
     * @return com.bsj.travel.def.global.JsonResult
     * @author ljx
     * @time 2024/1/15 14:49
     */
    JsonResult addDevice(DeviceDTO deviceDTO);

    /**
     * 删除设备
     *
     * @param deviceParamDTO
     * @return com.bsj.travel.def.global.JsonResult
     * @author ljx
     * @time 2024/1/15 14:49
     */
    JsonResult deleteDevice(DeviceParamDTO deviceParamDTO);

    /**
     * 修改设备
     *
     * @param deviceDTO
     * @return com.bsj.travel.def.global.JsonResult
     * @author ljx
     * @time 2024/1/15 14:49
     */
    JsonResult updateDevice(DeviceDTO deviceDTO);

    /**
     * 根据设备id获取设备信息
     *
     * @param deviceParamDTO
     * @return com.bsj.travel.def.common.VO.device.DeviceCorrelationInfoVO
     * @author ljx
     * @time 2024/1/15 14:49
     */
    DeviceCorrelationInfoVO getDeviceInfoById(DeviceParamDTO deviceParamDTO);

    /**
     * 设备分页
     *
     * @param deviceSearchDTO
     * @return com.bsj.travel.def.global.JsonResult<java.util.List < com.bsj.travel.def.common.VO.device.DeviceVO>>
     * @author ljx
     * @time 2024/1/15 14:50
     */
    JsonResult<List<DeviceVO>> pageDevice(DeviceSearchDTO deviceSearchDTO);

    /**
     * 是否禁用
     *
     * @param deviceParamDTO
     * @return com.bsj.travel.def.global.JsonResult
     * @author ljx
     * @time 2024/1/15 14:50
     */
    JsonResult whetherToDisable(DeviceParamDTO deviceParamDTO);

    /**
     * 批量添加设备
     *
     * @param deviceParamDTO
     * @return com.bsj.travel.def.global.JsonResult
     * @author ljx
     * @time 2024/1/15 14:51
     */
    JsonResult batchAddDevice(DeviceParamDTO deviceParamDTO);

    /**
     * 获取设备导出数据
     *
     * @param deviceSearchDTO
     * @return java.util.List<com.bsj.travel.def.common.VO.device.DeviceExcelVO>
     * @author ljx
     * @time 2024/1/17 19:06
     */
    List<DeviceExcelVO> getDeviceReportData(DeviceSearchDTO deviceSearchDTO);

    /**
     * 数量统计
     *
     * @param
     * @return java.util.Map<java.lang.String,java.lang.Object>
     * @author ljx
     * @time 2024/2/18 15:07
     */
    Map<String, Object> quantityCount();

    /**
     * 模糊搜索设备号
     *
     * @param productKey
     * @param value
     * @return java.util.List<java.lang.String>
     * @author ljx
     * @time 2024/3/20 19:16
     */
    List<String> fuzzySearchDeviceName(String productKey, String value);

    /**
     * 获取MQTT连接参数
     *
     * @param productKey
     * @param deviceName
     * @return com.bsj.travel.def.mqtt.auth.MqttSignature
     * @author ljx
     * @time 2024/3/22 14:40
     */
    MqttSignature getMqttSignature(String productKey, String deviceName);

    List<MqttSignatureExcelVO> getMqttSignatureReportData(String productKey);

    /**
     * 根据主题发布消息
     * @param productKey 产品key
     * @param deviceName 设备号
     * @param topic 主题信息
     * @param data 发布内容
     */
    JsonResult pubMqttMsg(String productKey, String deviceName,
                          String topic, String data, Integer qos);

    /**
     * 修改设备备注
     * @param deviceRemarkDTO
     * @return
     */
    JsonResult updateRemark(DeviceRemarkDTO deviceRemarkDTO);
}
